﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UnixTimeLocalTime.Common
{
    public class RandomDouble
    {
        public static double[] GenerateRandomOrderedNumbers(double lowerBoundInclusive, double upperBoundExclusive, int count, Random random = null)
        {
            random = random ?? new Random();
            return Enumerable.Range(0, count)
                .Select(i => random.NextDouble() * (upperBoundExclusive - lowerBoundInclusive) + lowerBoundInclusive)
                .OrderBy(d => d)
                .ToArray();
        }
    }
}
